

#ifndef __DISP_MANAGER_H
#define __DISP_MANAGER_H

//显示器结构体控制

#include "font_manager.h"

#include "commen.h"

typedef struct DispBuff{

int xres;int yres;
int b_p;unsigned char *buff;

}DispBuff ,* DispBuff_p;








typedef struct display_operation{

	char *name;
	int (*DeviceInit)(void);
	int (*DeviceExit)(void);
	int (*getbuff)(DispBuff_p dispBuff);//可以返回显存地址，得到分辨率，像素位数
	int  (*FLushRegion)(Region_p Regionp,DispBuff disbuff);//刷新某个区域
	struct display_operation *ptNEXT;

}display_operation, *display_operationp;



//将display_operation结构体注册进链表
void RegsiterDisplay(display_operationp display_operation_p);
void FramebufferInit(void);






//初始化系统
void DisplayInit(void );
//选择指定的设备（链表项）
int selectdefaulterDisplay(char * name);
//初始化设备
int initdefaulterDisplay(void);
DispBuff_p get_initdisbuffer(void);

int FlushDisplayRegion(Region_p Regionp, DispBuff disbuff);





void DrawFontBitMap(fontbitmap_p Fontbitmap_p, unsigned int color_double);
void DrawRegion(Region_p pRegion, unsigned int color_double);
void putpixel(int x, int y ,unsigned int color_double);
void lcd_clear(void);

void DrawTextInRegionCentral( char *name , Region_p pRegion, unsigned int color_double);



#endif





